
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#"><img src="./public/home/imgs/logo.png" id="logo1"></a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class=""><a href="./index.php">首页 <span class="sr-only">(current)</span></a></li>
                <!--引入顶级分类-->
                <?php require ROOT_PATH ."com/category.php"?>

            </ul>
            <form class="navbar-form navbar-right" action="<?php echo ROOT_URL?>check_goods.php" method="post">
                <div class="form-group">

                    <input type="text" name="key_name" class="form-control" placeholder="输入商品名称关键字搜索" value="<?php echo !empty($_POST['key_name']) == 1 ? $_POST['key_name']: ''?>">
                </div>
                <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
            </form>
            <ul class="nav navbar-nav navbar-right index_nav">

                <?php if(empty($_SESSION['home'])){?>

                    <li><a href="./login.php">你好!!!请登录</a></li>
                    <li><a href="./reg.php" class="reg">免费注册</a></li>
                <?php }else{?>
                    <?php if(empty($_SESSION['home']['head_image'])):?>
                        <li>
                                <img class="mt10" src="<?php echo ROOT_URL?>user_head/1.jpg">
                        </li>

                    <?php else:?>
                        <li>

                                <img class="mt10" src="<?php echo get_img_url(ROOT_URL.'user_head/',$_SESSION['home']['head_image'],30)?>">

                        </li>
                    <?php endif;?>

                    <li><a href="#"><?php echo $_SESSION['home']['name'] ?></a></li>
                    <li><a href="./cart.php">购物车<span class="glyphicon glyphicon-shopping-cart"></span></a></li>
                    <li><a href="./user_center.php">个人中心</a></li>
                    <li><a href="./com/logout.php">退出</a></li>
                <?php }?>
                <li><a href="#">帮助中心</a></li>
                <li><a href="#">客服电话</a></li>

            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>